package com.qf.spring.mybatis.service.impl;

import com.qf.spring.mybatis.mapper.UserMapper;
import com.qf.spring.mybatis.pojo.User;
import com.qf.spring.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 王博康
 * @version 1.0
 * @project 04_spring_mybatis
 * @description: TODO
 * @date 2022/3/7 20:14 星期一
 */
@Component
public class UserServiceImpl implements UserService {

    private UserMapper userMapper;
    @Autowired
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public User findById(Long id) {
        return userMapper.findById(id);
    }

    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }
}
